Skip to content

Conversation

@BenBrock
Copy link
Collaborator

• Implemented conjugated support alongside scaled with a new conjugated_view and inspector logic to detect
conjugated inputs. Reference backend now conjugates values via std::conj, while vendor backends either
apply conjugate-transpose where supported (oneMKL CSC) or throw when conjugated views are passed. Added
complex-number SpMV tests for conjugated A and B.

Testing:

  • make -C build -j $(nproc)
  • ./build/test/gtest/spblas-tests

@BenBrock BenBrock marked this pull request as ready for review January 22, 2026 21:18
@BenBrock BenBrock requested a review from spencerpatty January 22, 2026 21:19
@BenBrock
Copy link
Collaborator Author

This PR is ready to merge. Currently the conjugate tests are only run on the reference backend and oneMKL. Once we add conjugate support to the other backends, we can enable the tests for them.

Some tests are failing on cuSPARSE and rocSPARSE, but this PR doesn't touch any related code, so I think that is unrelated. It might be an issue with the machines the self-hosted runners are on.

Comment on lines +44 to +48
if (__detail::is_conjugated(a) || __detail::is_conjugated(b) ||
__detail::is_conjugated(c)) {
throw std::runtime_error(
"aoclsparse backend does not support conjugated views.");
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so here is a design question it seems like we should have the following checks:

not transposed + not conjugate == is_nontransposed
not transposed + conjugate == is_conjugated
transposed + not conjugate == is_transposed
transposed + conjugate == is_conjugate_transposed

MKL and AOCL and other libraries support nontranspose/transpose/conjugatetranspose but not conjugate. in the is_conjugated() function do we need to rule out is_transposed() so we can correctly capture conjugate_transpose ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nevermind, it just hasn't been implemented yet here. see mkl backend for actual implementation.

Copy link
Contributor

@spencerpatty spencerpatty Jan 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User Data: input is CSR

csr_view<I,O,T>csrV(/* user data in csr */);
matrix_handle csrA(csrV);

sparse::spmv(transposed(csrA), x,y) // y = A^T * x
sparse::spmv(conjugated(transposed(csrA)), x,y) // y = A^H * x
sparse::spmm(csrA,W,Z)  // Z = A*W

converts to in MKL backend

mkl::sparse::matrix_handle_t csrA;
mkl::sparse::set_csr_data(csrA, /* user data */)
mkl::sparse::gemv(csrA, transpose::trans, x,y)
mkl::sparse::gemv(csrA, transpose::conjtrans, x,y)
mkl::sparse::gemm(csrA, transpose::nontrans, W, Z)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants